package com.envy.product.utils;

import com.envy.product.vo.ResultVO;

public class ResultVOUtil {
    //成功，且有内容（内容为参数）
    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setMsg("成功");
        resultVO.setCode(0);
        resultVO.setData(object);
        return resultVO;
    }

    //成功，没有内容
    public static ResultVO success(){
        return success(null);
    }

    //失败，有状态码和提示语
    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
